<?php
/**
 * The following variables are available in this template:
 * - $this: the BootCrudCode object
 */
/** @var AweCrudCode $this */
?>
<?php echo "<?php\n" ?>
/** @var <?php echo $this->controllerClass; ?> $this */
/** @var <?php echo $this->modelClass; ?> $model */
<?php
$label = $this->pluralize($this->class2name($this->modelClass));
echo "\$this->breadcrumbs=array(
	'$label'=>array('index'),
	Yii::t('AweCrud.app', 'Manage'),
);\n";
?>


    $this->menu=array(
array('label' => Yii::t('AweCrud.app', 'List') . ' ' . <?php echo $this->modelClass ?>::label(2), 'icon' => 'list', 'url' => array('index')),
array('label' => Yii::t('AweCrud.app', 'Create') . ' ' . <?php echo $this->modelClass ?>::label(), 'icon' => 'plus', 'url' => array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('<?php echo $this->class2id($this->modelClass); ?>-grid', {
data: $(this).serialize()
});
return false;
});
");
?>



<div class="row-fluid">
    <div class="span-12">
        <div class="well blue">
            <div class="well-header">
                <h5>Form elements</h5>
                <ul>
                    <li class="color_pick"><a href="#"><i class="icon-th"></i></a>
                        <ul>
                            <li><a class="blue set_color" href="#"></a></li>
                            <li><a class="light_blue set_color" href="#"></a></li>
                            <li><a class="grey set_color" href="#"></a></li>
                            <li><a class="pink set_color" href="#"></a></li>
                            <li><a class="red set_color" href="#"></a></li>
                            <li><a class="orange set_color" href="#"></a></li>
                            <li><a class="yellow set_color" href="#"></a></li>
                            <li><a class="green set_color" href="#"></a></li>
                            <li><a class="dark_green set_color" href="#"></a></li>
                            <li><a class="turq set_color" href="#"></a></li>
                            <li><a class="dark_turq set_color" href="#"></a></li>
                            <li><a class="purple set_color" href="#"></a></li>
                            <li><a class="violet set_color" href="#"></a></li>
                            <li><a class="dark_blue set_color" href="#"></a></li>
                            <li><a class="dark_red set_color" href="#"></a></li>
                            <li><a class="brown set_color" href="#"></a></li>
                            <li><a class="black set_color" href="#"></a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="well-content no-search">
                <fieldset>
                    <legend>
                        <?php echo "<?php echo Yii::t('AweCrud.app', 'Manage') ?>" ?> <?php echo "<?php echo {$this->modelClass}::label(2) ?>" ?>
                    </legend>

                    <?php echo "<?php echo CHtml::link('<i class=\"icon-search\"></i> ' . Yii::t('AweCrud.app', 'Advanced Search'), '#', array('class' => 'search-button btn')) ?>" ?>

                    <div class="search-form" style="display:none">
                        <?php echo "<?php \$this->renderPartial('_search',array('model' => \$model,)); ?>\n"; ?>
                    </div><!-- search-form -->

                    <?php echo "<?php"; ?> $this->widget('bootstrap.widgets.TbGridView',array(
                    'id' => '<?php echo $this->class2id($this->modelClass); ?>-grid',
                    'type' => 'striped condensed',
                    'dataProvider' => $model->search(),
                    'filter' => $model,
                    'columns' => array(
                    <?php
                    $count = 0;
                    foreach ($this->tableSchema->columns as $column) {
                        if (++$count == 7):
                            ?>
                            /*<?php echo "\n" ?>
                        <?php endif; ?>
                        <?php echo $this->generateGridViewColumn($this->modelClass, $column) . ",\n" ?>
                        <?php
                    }
                    if ($count >= 7):
                        ?>
                        */<?php echo "\n" ?>
                    <?php endif; ?>
                    array(
                    'class'=>'bootstrap.widgets.TbButtonColumn',
                    ),
                    ),
                    )); ?>
                </fieldset>

            </div>
        </div>
    </div>
</div>